//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	IFormsFactory.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System.Collections.Generic;

namespace Smart.Common.Forms
{
	/// <summary>
	/// Forms factory
	/// </summary>
	public interface IFormsFactory
	{
		/// <summary>
		/// Get forms service by serviceName
		/// </summary>
		IFormsService GetService(string serviceName);

		/// <summary>
		/// Build form for <paramref name="entity"/> in <paramref name="container"/>
		/// </summary>
		bool BuildForm(string serviceName, IFormEntity entity, IFormContainer container, MetaFormMode mode, IDictionary<string, object> values);

		/// <summary>
		/// Build form for <paramref name="entity"/> in <paramref name="container"/> and save entity values
		/// </summary>
		bool BuildFormAndSave(string serviceName, IFormEntity entity, IFormContainer container, MetaFormMode mode, IDictionary<string, object> values);
	}
}